package com.igor.bookStore.tapestry.components;

import org.apache.tapestry5.annotations.ApplicationState;

import com.igor.bookStore.inface.User;

public class NavMenu {
	@ApplicationState
	private User user;
	private boolean userExists;

	public User getUser() {
		return this.user;
	}

	public String getLoggedUser() {
		if (userExists) {
			return getUser().getUserName();
		}
		return "";
	}

	public boolean isAdmin() {
		if (getLoggedUser().equalsIgnoreCase("admin"))
			return true;
		else
			return false;
	}

	public boolean isNotAdmin() {
		if (!getLoggedUser().equalsIgnoreCase("admin"))
			return true;
		else
			return false;
	}
}
